package com.wxg.tuan.interceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;

public class LoginInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("LoginInterceptor preHandle...");
        String token = request.getHeader("authorization");
        System.out.println("token:"+token);
        //接受前端发过来的token,校验token是否有效
        if (token!=null&&token.startsWith("Bearer")){

        }
        return false;//放行
    }
}